<?
if(!isset($head)){
	$head="";
}
?><!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Backend</title>
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('css/backend.css')?>" />
	
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('jslib/jquery-ui-1.8.16.custom/css/smoothness/jquery-ui-1.8.16.custom.css')?>" />
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('jslib/jquery-timepicker/jquery-timepicker-addon.css')?>" />
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('jslib/jquery.countdown.package-1.5.9/jquery.countdown.css')?>" />
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-1.6.4.min.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-ui-1.8.16.custom/development-bundle/external/jquery.cookie.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-validation-1.8.1/jquery.validate.min.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-timepicker/jquery-timepicker-addon.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery.countdown.package-1.5.9/jquery.countdown.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery.maskedinput/jquery.maskedinput.js')?>"></script>
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('jslib/flexigrid-1.1/css/flexigrid.css')?>" />
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/flexigrid-1.1/js/flexigrid.js')?>"></script>
	<link type="text/css" rel="stylesheet" media="screen" href="<?=base_url('jslib/chosen/chosen.css')?>" />
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/chosen/chosen.jquery.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-easy-confirm-dialog/jquery.easy-confirm-dialog.js')?>"></script>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/jquery-form/jquery.form.js')?>"></script>
<?=$head?>
	<script type="text/javascript" language="javascript" src="<?=base_url('jslib/backend.js')?>"></script>
	<script type="text/javascript" language="javascript">
		$(function(){
			$('<li style="float:right; margin-bottom:2px;" class="ui-state-default ui-corner-all"><a style="padding:.4em .8em;" href="<?=site_url('/auth/logout/')?>">Log Out</a></li>').insertBefore('#options-tab-li');
		});
	</script>
</head>
<body>
<div id="container">
	<div id="tabs">
		<ul>
			<li><a href="#invoices">Invoices</a></li>
			<li><a href="#clients">Clients</a></li>
			<li style="display:none;"><a href="#timetrack">Time Tracking</a></li>
			<li id="options-tab-li" style="float:right;"><a href="#options">Options</a></li>
		</ul>
		<div id="invoices" class="ui-helper-reset">
			<div>
				<?=$this->load->view('backend/invoices/table',array(),true)?>
			</div>
			<div id="invoice-dialog-form" title="Edit/Modify Invoice">
				<?=$this->load->view('backend/invoices/form',array(),true)?>
			</div>
		</div>
		<div id="clients">
			<div>
				<?=$this->load->view('backend/clients/table',array(),true)?>
			</div>
			<div id="client-dialog-form" title="Add/Edit Client">
				<?=$this->load->view('backend/clients/form',array(),true)?>
			</div>
		</div>
		<div id="timetrack">
			<?=$this->load->view('backend/timetrack/table',array(),true)?>
			<div style="margin-left:auto;width:150px;">
				<button id="timetrack-new-btn">New Entry</button>
			</div>
			<div id="timetrack-dialog-form" title="Add/Edit Time Entry">
				<?=$this->load->view('backend/timetrack/form',array(),true)?>
			</div>
		</div>
		<div id="options" class="form_container">
			<?=$this->load->view('backend/options/profiles',array("profiles"=>$profiles),true)?>
		</div>
	</div>
</div>
</body>
</html>
